package lab01;

import java.util.Random;
import java.util.Scanner;

/**
 * Created by Administrator on 2017/10/8.
 */
public class Test08 {
    public static void main(String[] args) {
        int rightNum =new Random().nextInt(100) + 1;
        Scanner scanner =new Scanner(System.in);
        int input=0;
        do{
            System.out.println("请猜数字（1-100）!");
            input=scanner.nextInt();

            if(input>rightNum){
                System.out.println("猜大了！");
            }else if(input<rightNum){
                System.out.println("猜小了！");
            }
        }while (input!=rightNum);
        System.out.println("猜对了" +rightNum);
    }
}
